home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2000 February / Macworld (2000-02).dmg / Shareware World / Comms & Internet / Flex-Able 1.0 / .admin / count.able next >
Text File  |  1999-12-07  |  3KB  |  132 lines

  1.  
  2. <:set form <:read_form>>
  3.  
  4. <!-- authorization first -->
  5. <:set admin <:use_settings "/.admin/pass">>
  6. <:ifequal env["REMOTE_PASSWORD"] admin[env["REMOTE_USER"]]>
  7.     <:set ok 1>
  8. <:else>
  9.     <:set ok 0>
  10.     <:request_credentials "SITE_ADMIN">
  11. <:/ifequal>
  12.  
  13.  
  14.  
  15. <:set counters <:use_settings "/.admin/counters">>
  16.  
  17. <:require counters["counter admin"]><:else>
  18.     <:set counters["counter admin"] 0>
  19. <:/require>
  20.  
  21. <!-- form data
  22. <:foreach name value form>
  23.     <:echo name " = " value>
  24. <:/foreach>
  25. -->
  26.  
  27. <html>
  28.     <head>
  29.         <link rel=stylesheet type="text/css" HREF="faadmin.css">
  30.         <title>Flex-Able: Admin: Counters</title>
  31.     </head>
  32. <body>
  33.  
  34.  
  35. <:ifequal ok 1>
  36.  
  37.     <!-- make changes to our data -->
  38.     <:require form["$delete"]>
  39.         <:foreach index value form["$delete"]>
  40.             <:set counters[value]>
  41.         <:/foreach>
  42.     <:/require>
  43.     
  44.     <:require form["$newcounter"]>
  45.         <:set counters[<:omit form["$newcounter"] "$">] <:new "INTG" form["$newvalue"]>>
  46.     <:/require>
  47.     
  48.     <:foreach name value form>
  49.         <:ifempty <:substring name "$">>
  50.             <:set counters[name] <:new "INTG" value>>
  51.         <:/ifempty>
  52.     <:/foreach>
  53.     
  54.     <:require form["$checkpoint"]>
  55.         <:set counters["$checkpoint"] form["$checkpoint"]>
  56.     <:else>
  57.         <:ifempty counters["$checkpoint"]>
  58.             <:set counters["$checkpoint"] "20">
  59.         <:/ifempty>
  60.     <:/require>
  61.  
  62.     <DIV CLASS="topic">Counter Administration</DIV>
  63.     <p><br>
  64.     <p><br>
  65.     
  66.     
  67.     <form action=count.able method=post>
  68.         <table bgcolor="#e0e0e0" border=1>
  69.             <tr>
  70.                 <th></th>
  71.                 <th>Counter Name</th>
  72.                 <th>Current Value</th>
  73.                 <th>Delete</th>
  74.             </tr>
  75.             <:foreach name value counters><:ifempty <:substring name "$">>
  76.                 <tr>
  77.                     <td></td>
  78.                     <td><:echo name></td>
  79.                     <td><:echo value></td>
  80.                     <td><input type=checkbox name="$delete" value="<:echo name>"></td>
  81.                 </tr>
  82.             <:/ifempty><:/foreach>
  83.             <tr>
  84.                 <th>New Counter</th>
  85.                 <td><input type=text name="$newcounter" value="" size=20></td>
  86.                 <td><input type=text name="$newvalue" value="" size=7></td>
  87.                 <td>n/a</td>
  88.             </tr>
  89.         </table>
  90.         Save counters every <input type=text name="$checkpoint" size=3 value="<:echo counters["$checkpoint"]>"> minutes<P>
  91.         
  92.         <input type=submit value="Submit"> <input type=reset value="Clear">
  93.     </form></ul>
  94.     
  95.     <h3>Using Counters</h3>
  96.     
  97.     To use a counter, insert the following line near the beginning of your page:<P>
  98.     <blockquote>
  99.         <:set counters <:use_settings "/.admin/counters">>
  100.     </blockquote>
  101.         
  102.     Where you want the counter to appear, use one of the following insertion commands:<P>
  103.     
  104.     <TABLE CLASS="tablestyle1">
  105.         <tr>
  106.             <th align=left>Counter Name</th> 
  107.             <th align=right>Insertion Command</th>
  108.             <th align=right>Value</th>
  109.     <:foreach index value counters>
  110.         <:ifequal "INTG" <:type_of value>>
  111.         <tr>
  112.             <td align=left><:echo index></td>
  113.             <td align=right><:count counters["<:echo index>"]></td>
  114.             <td align=right><:echo value></td>
  115.         </tr><:/ifequal><:/foreach>
  116.     </TABLE>
  117.     <P>
  118.     
  119.     
  120. <:else>
  121.  
  122.     <DIV CLASS="topic">You do not have permission to view or change the counters.</DIV>
  123.  
  124. <:/ifequal>
  125.  
  126.  
  127. This page has been viewed <:count counters["counter admin"]> times.  <a href="count.able">Refresh</a>
  128. <hr>
  129. <A HREF="default.html" CLASS="back">back to Admin Home</A> 
  130. </body>
  131. </html> 
  132.